;;; packages.el --- ctrl-org layer packages file for Spacemacs.
;;

(defconst ctrl-org-packages
  '((org :location built-in)))

(defun ctrl-org/post-init-org ()
  (with-eval-after-load 'org
    (progn
      ;; stop the confirmation to evaluate source code
      ;; https://emacs.stackexchange.com/questions/23946/how-can-i-stop-the-confirmation-to-evaluate-source-code-when-exporting-to-html
      (setq org-confirm-babel-evaluate nil)

      ;; set specific python interpreter, use full file path, default was python2
      ;; also can specific python exec file path, like this
      ;; #+BEGIN_SRC python :python /opt/local/bin/python2.7 :results output
      ;; print "python 2"
      ;; #+END_SRC
      ;; (setq org-babel-python-command "/usr/bin/python3")

      ;; define languages which can be evaluated in Org buffers
      (org-babel-do-load-languages
       'org-babel-load-languages
       '((shell . t)
         (js . t)
         (python . t)
         (ipython . t)
         (emacs-lisp . t)))
      )
    (setq org-todo-keywords
      '((sequence "TODO(t)"  "DOING(i)"  "DONE(d)"  "HANGING(h)"  "CANCELED(c)")))

    ;; set indentation for the content of a source code block to 0
    ;; original value was 2, It's not easy to edit directly
    ;; (setq org-edit-src-content-indentation 0)

    (define-key org-mode-map (kbd "C-a") #'mwim-beginning-of-code-or-line)))

;;; packages.el ends here
